<template>
    <div>
        <div class="listStyle" v-for="(item,index) in dataList" :key="index" @click="detailCilck(item.id)">
            <div>
                <div>{{ item.name }}</div>
                <div>{{ item.name }}</div>
                <div>{{ item.date }}</div>
            </div>
            <div>
                <img :src="item.img" alt="">
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'list',
    data() {
        return {

        };
    },
    props: ['dataList'],
    mounted() {

    },

    methods: {
        detailCilck(id) {
            // console.log(id);
            this.$emit("listId",id)
        }
    },
};
</script>

<style scoped>
.listStyle {
    width: 100%;
    height: auto;
    display: flex;
    cursor: pointer;
    padding: 1.25rem 0;
    justify-content: space-between;
    border-bottom: 0.0625rem solid #eee;
}
.listStyle>div:nth-child(1){
    display: flex;
    justify-content: space-around;
    flex-direction: column;
}
.listStyle>div:nth-child(1)>div:nth-child(1){
    font-size: 1.1rem;
}
.listStyle>div:nth-child(1)>div:nth-child(1)::before {
    content: "";
    margin-bottom: 0.1875rem;
    display: inline-block;
    width: 0.25rem;
    height: 0.25rem;
    background-color: #D8D8D8;
    border-radius: 50%;
    margin-right: 0.3125rem;
}
.listStyle>div:nth-child(1)>div:nth-child(1):hover::before {
  background-color: #648AFF; /* 在悬停时修改背景颜色 */
}
.listStyle>div:nth-child(1)>div:nth-child(2){
    margin-left: 0.625rem;
    font-size: 0.9rem;
}
.listStyle>div:nth-child(1)>div:nth-child(3){
    margin-left: 0.625rem;
    font-size: 0.8rem;
    color: #666666;
}
.listStyle>div:nth-child(1)>div:nth-child(1):hover{
    font-weight: bold;
    color: #648AFF;
}
.listStyle>div:nth-child(2) {
    width: 12.5rem;
    height: 6.25rem;
}

.listStyle div img {
    width: 100%;
    border-radius: 0.625rem;
    height: 100%;
}
</style>